from threading import Thread
import threading
import time
# 车票
ticket = 50
def sale_tacket():
    global ticket
    # 每个窗口有100人
    for i in range(100):
        if ticket > 0:
            print(f"{threading.current_thread().name}正在售票：{ticket}")
            ticket -= 1
            time.sleep(1)
if __name__ == '__main__':
    for i in range(3):
        t = Thread(target=sale_tacket)
        t.start()